import { findDictentryByDicttypeName } from "../api/index.js";
export const getDictList = (dicts = []) => {
  dicts = ["etc_channel", "vehicle_color"];
  let arr = dicts.map((dictName) => {
    return new Promise(async (resolve, reject) => {
      let res = await findDictentryByDicttypeName({ dicttypeName: dictName });
      if (res.code == 1) {
        resolve({ [dictName]: res.data });
      } else {
        reject();
      }
    });
  });
  return Promise.all(arr);
};

export const filterNull = (value) => {
  if (!value) {
    return "-";
  } else {
    return value;
  }
};
